package com.ruoyi.system.wnjk.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.wnjk.domain.po.ShopPayOrder;
import com.ruoyi.system.wnjk.service.IShopPayOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopPayOrderMapper;

/**
 * 支付订单Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-14
 */
@Service
public class ShopPayOrderServiceImpl implements IShopPayOrderService
{
    @Autowired
    private ShopPayOrderMapper shopPayOrderMapper;

    /**
     * 查询支付订单
     *
     * @param id 支付订单主键
     * @return 支付订单
     */
    @Override
    public ShopPayOrder selectShopPayOrderById(Long id)
    {
        return shopPayOrderMapper.selectShopPayOrderById(id);
    }

    /**
     * 查询支付订单列表
     *
     * @param shopPayOrder 支付订单
     * @return 支付订单
     */
    @Override
    public List<ShopPayOrder> selectShopPayOrderList(ShopPayOrder shopPayOrder)
    {
        return shopPayOrderMapper.selectShopPayOrderList(shopPayOrder);
    }

    /**
     * 新增支付订单
     *
     * @param shopPayOrder 支付订单
     * @return 结果
     */
    @Override
    public int insertShopPayOrder(ShopPayOrder shopPayOrder)
    {
        shopPayOrder.setCreateTime(DateUtils.getNowDate());
        return shopPayOrderMapper.insertShopPayOrder(shopPayOrder);
    }

    /**
     * 修改支付订单
     *
     * @param shopPayOrder 支付订单
     * @return 结果
     */
    @Override
    public int updateShopPayOrder(ShopPayOrder shopPayOrder)
    {
        shopPayOrder.setUpdateTime(DateUtils.getNowDate());
        return shopPayOrderMapper.updateShopPayOrder(shopPayOrder);
    }

    /**
     * 批量删除支付订单
     *
     * @param ids 需要删除的支付订单主键
     * @return 结果
     */
    @Override
    public int deleteShopPayOrderByIds(Long[] ids)
    {
        return shopPayOrderMapper.deleteShopPayOrderByIds(ids);
    }

    /**
     * 删除支付订单信息
     *
     * @param id 支付订单主键
     * @return 结果
     */
    @Override
    public int deleteShopPayOrderById(Long id)
    {
        return shopPayOrderMapper.deleteShopPayOrderById(id);
    }
}
